/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.dusty.lab2.raid.utils;

import java.io.File;

/**
 *
 * @author Dusty
 */
public class Utils {
    
    public static boolean checkRaid(String root, RaidConfig config) {
        for (int i = 0; i < config.getDisksCount(); i++) {
            File file = new File(root + File.separator + "disk" + i);
            if (!file.exists() || !file.isFile() || !file.canRead()) return false;
        }
        
        return true;
    }
    
}
